<?php

namespace App\models;

use App\models\User;

/**
*
*/
class UserForm
{
  private $_token;
  private $_info;
  private $_user;
  private $msg;

  function __construct($token,&$ci)
  {
    $this->_token = $token;
    $this->_user = new User($ci);
    $this->_info = $this->_user->getInfo($token);
  }

  public function init()
  {
    $this->msg['code'] = $this->msg['data']['code'] = 200;
    $this->msg['data']['uid'] = $this->_info['uid'];
    $this->msg['data']['username'] = $this->_info['user_login'];
  }

  public function getMessage()
  {
    return $this->msg;
  }
}
 
